<?php
require_once('admin/common/constants.php');
// CHECK TO SEE IF THIS IS A MAIL POST
if (isset($_POST['first_name'])) {
	
	$message = '';
	$message .= 'First Name: ' 	. $_POST['first_name']	. "<br />";
	$message .= 'Last Name : ' 	. $_POST['last_name']	. "<br />";
	$message .= 'Email: ' 		. $_POST['email']		. "<br />";
	$message .= 'Phone: ' 		. $_POST['telephone']	. "<br />";
	$message .= 'Comment: ' 	. $_POST['comments']	. "<br />";
	
	$to = CONTACT_INTERNAL_LIST;
	$subject = "Enquiry from Leisure Biz - " . $_POST['res_name'];
	$headers = "From: " . CONTACT_MAIL_FROM . "\r\n";
	$headers .= 'Cc: ' . CONTACT_MAIL_INTERNAL_CC . "\r\n";
	$headers .= "MIME-Version: 1.0\r\n";
	$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
		
    header('Location: Contact_Us.html?res=success');
    if (mail($to, $subject, $message, $headers)) {
    	//echo 'Your message has been sent.';
    } else {
    	echo 'There was a problem sending the email.';
    }
    // DON'T BOTHER CONTINUING TO THE HTML...
    die();
}
